package kuzha.ast;

public class MapLiteral extends Literal {
	public final MapElement[] elms;

	public MapLiteral(MapElement... elms) {
		if (elms == null)
			throw new IllegalArgumentException();
		this.elms = elms.clone();
	}
	
	@Override
	public void accept(AstVisitor visitor) {
		visitor.visit(this);
	}
	@Override
	public <A, R> R accept(AstVisitor2<A, R> visitor, A object) {
		return visitor.visit(this, object);
	}
	
	public MapElement getElement(int i) {
		return elms[i];
	}
	public int getElementCount() {
		return elms.length;
	}
}
